#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main() {
    int n, k;
    long long sum = 0;
    vector<long long> v;
    cin >> n >> k;
    v.reserve(n);
    for (int i = 0;i < n;i++)
    {
        int tmp = 0;
        cin >> tmp;
        if (tmp % 2 != 0)
            sum += tmp;
        else
            v.push_back(tmp);
    }

    sort(v.begin(), v.end(), greater<int>());

    for (int i = 0; i < v.size() - 1; i++)
    {
        while (k >= 1 && v[i] >= v[i + 1] && v[i] % 2 == 0)
        {
            v[i] /= 2;
            k--;
        }
    }

    while (k > 0)
    {
        v[v.size()-1] /= 2;
        k--;
    }

    for (int i = 0;i < v.size();i++)
        sum += v[i];

    cout << sum << endl;

    return 0;
}